package jman.teemwork15;

import java.sql.SQLException;

public class UserService {
	public static String loginId;
	public boolean Login(String id,String password) throws SQLException{
		boolean flag=false;
		UserDao ud=new UserDao();
		if(id!=null&&password!=null){
			User user=ud.getUserById(id);
			if(password.equals(user.getPassword())){
				flag=true;
			}
		}
		return flag;
	}
	public String searchUserNameById(String id) throws SQLException{
		UserDao ud=new UserDao();
		User user=ud.getUserById(id);
		return user.getUserName();
	}
}
